package test02;

public class CureTest extends Thread {

	@Override
	public void run() {
		for (int i = 1; i <=10; i++) {
			System.out.println("特需号："+i+"号病人在看病");
			try {
				Thread.sleep(2000);
			} catch (Exception e) {
				// TODO: handle exception
				e.printStackTrace();
			}
		}
	}
	public static void main(String[] args) {
		CureTest cureTest=new CureTest();
		cureTest.setPriority(MAX_PRIORITY);
		cureTest.start();
		for (int i = 1; i <=50; i++) {
			try {
			System.out.println("普通号："+i+"号病人在看病");
				Thread.sleep(4000);
				if (i==10) {
					cureTest.join();
				}
			} catch (Exception e) {
				// TODO: handle exception
				e.printStackTrace();
			}
		}
				
	}
}
